from until.ext import Base, engine, session
from until.models import User
from datetime import datetime
from dateutil.relativedelta import relativedelta
import uuid

# Base.metadata.create_all(engine)  # 通过此语句创建表
date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
date_use = datetime.now() + relativedelta(years=1)
uid = str(uuid.uuid1())
# user = User(drivce_id=uid, use_date=date_use, join_time=date)
# session.add(user)
# session.commit()
res = session.query(User).filter(User.use_date == date_use).first()

print(res)
